import request from '@/config/axios'
import { RetrieveVarietyParams } from './types'
import { VarietyItem } from '@/views/SysManage/types/variety'

export const RetrieveVarietyScopes = (): Promise<IResponse> => {
  return request.get({ url: '/v1/admin/variety/scopes/' })
}

export const RetrieveVariety = (params: RetrieveVarietyParams): Promise<IResponse> => {
  return request.get({ url: '/v1/admin/variety/retrieve/', params })
}
export const UpdateVariety = async (data: VarietyItem) => {
  return request.put({ url: '/v1/admin/variety/update/', data })
}
export const CreateVariety = async (data: VarietyItem) => {
  return request.post({ url: '/v1/admin/variety/create/', data })
}
